$(function(){
        // 视频高度97%，宽度16：9自适应.0.5625=9/16

      sh.autoWidth(".video-content",0.5625);
      // console.log($(".video-content").width());
      // console.log($(".video-content").height());
       // $(window).resize(function(){
       //     sh.autoWidth(".video-content",0.5625);
       // })

    $(".voice-controll input").rangeslider({
        polyfill: false
    });

    $(".start-video-btn").on("click","a",function () {
        if($(this).attr("ispause") == 0){
            $(this).children("img").attr("src","images/icon/pause.png");
            $(this).attr("ispause","1");
            $(".pause-icon").hide();
        }else{
            $(this).children("img").attr("src","images/icon/video_icon_23.png");
            $(this).attr("ispause","0");
            $(".pause-icon").show();
        }
    })

    //监听音量调节的值
    $(document).on('input', "#volumn", function(e) {
        var value = e.target.value;
        // console.log(value)
    });

    $(".video-main-right-bar").on("click","a",function () {
        slideRight($(".video-info-wrap"),$(".video-main-right-sildeback-bar"),"normal")
    })

    var timer = setTimeout(function () {
        slideRight($(".video-info-wrap"),$(".video-main-right-sildeback-bar"),"normal")
    },2000);

    $(".video-main-wrap").on("click",".video-main-right-sildeback-bar",function () {
        $(".video-info-wrap").animate({right:"0"},"normal");
        // $(".video-info-wrap").show();
        $(this).hide();
        // sh.autoWidth(".video-content",0.5625);
    })


    $(".pause-icon").on("click",function () {
        $(this).hide();
        $(".start-video-btn a").children("img").attr("src","images/icon/pause.png");
        $(".start-video-btn a").attr("ispause","1");
    })

    var mySwiper = new Swiper('.swiper-container',{
        scrollContainer: true,
        scrollbar: {
            container: '.swiper-scrollbar'
        },
        mode: 'vertical'
    })

})


var slideRight = function(target,rightbar,speed){
    target.animate({right:"-30%"},speed);
    clearTimeout(timer);
    var timer = setTimeout(function () {
        rightbar.css("display","table-cell");
    },350)
}

